package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Follow;
import cn.wolfcode.trip.base.mapper.FollowMapper;
import cn.wolfcode.trip.base.service.IFollowService;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by 24106 on 2018/8/30.
 */
@Service
public class FollowServiceImpl implements IFollowService{
    @Autowired
    private FollowMapper followMapper;

    public Follow getRelation(Follow follow) {
        return followMapper.getRelation(follow);
    }

    public void save(Follow follow) {
        //保存的时候,创建一个时间
        follow.setFollowTime(new Date());
        followMapper.insert(follow);
    }

    public void delete(Long fanId,Long followId) {
        followMapper.delete(fanId,followId);
    }
}
